package com.dxg.msns.gateway.utils;

import org.springframework.http.HttpCookie;
import org.springframework.http.server.reactive.ServerHttpRequest;

import java.util.List;

public class GatewayCookieUtils {

    public static String getCookieValue(ServerHttpRequest request, String cookieName) {
        List<HttpCookie> cookies = request.getCookies().get(cookieName);
        if (cookies != null && !cookies.isEmpty()) {
            return cookies.get(0).getValue();
        }
        return null;
    }
}